package com.xuluoji.urldecoder;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.xuluoji.urldecoder.MainActivity;

public class LineSchemeServiceActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_line_scheme);

        schemeParse(getIntent());
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);

        schemeParse(intent);
    }

    private void schemeParse(Intent intent) {
        Intent it = new Intent(getApplicationContext(), MainActivity.class);
        Uri uri = intent.getData();
        if (uri != null) {
            it.setData(uri);
        }
        startActivity(it);
    }

}
